import {request} from './request.js'

export function getActivityDetailApi(id){
	return request({
		url: `/api/event/getVolEventById/${id}`,
		method: 'get'
	})
}

export function isJoinApi(eventId,userId){
	return request({
		url: `/api/event/isEnroll?eventId=${eventId}&userId=${userId}`,
		method: 'get'
	})
}

export function getActivityByUserId(userId,status,current,pageSize){
	return request({
		url: `/api/eventVol/list?userId=${userId}&status=${status}&current=${current}&pageSize=${pageSize}`,
		method: 'get',
	})
}

export function addActivityApi(event){
	return request({
		url: '/api/event/addOrUpdateVolEvent}',
		method: 'post',
		data: event
	})
}

export function joinActivityApi(eventId,userId){
	return request({
		url: `/api/event/signUpEvent?eventId=${eventId}&userId=${userId}`,
		method: 'get'
	})
}

export function unJoinActivityApi(eventId,userId){
	return request({
		url: `/api/event/cancelEvent?eventId=${eventId}&userId=${userId}`,
		method: 'get'
	})
}

export function getActivityPeople(eventId){
	return request({
		url: `/api/eventVol/getEventVolVo?eventId=${eventId}`,
		method: 'get'
	})
}